package com.wzy.oa_sys.controller.robot;

import com.wzy.oa_sys.model.request.robot.RobotReq;
import com.wzy.oa_sys.service.robot.RobotService;
import com.wzy.oa_sys.util.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/robot")
public class RobotController {

    @Autowired
    private RobotService robotService;


    @PostMapping("/getRobotReply")
    public String getRobotReply(@RequestBody RobotReq robotReq, HttpServletRequest request) {
        //当前用户角色，用于限制部分机器人回复
        System.out.println("当前用户的提问："+robotReq.toString());
        String robotReply = robotService.getRobotReply(robotReq,request);
        return robotReply;
    }

}
